import { useState, useEffect, useLayoutEffect } from "react"

const App = () => {
  const [ count, setCount ] = useState(10) 
  const add = () => {
    setCount(count + 1)
  }

  // useEffect(() => {
  //   document.title = count + '次'
  //   console.log(1111)
  // })
  useLayoutEffect(() => {
    document.title = count + '次'
  })
  return (
    <div>
      <button onClick = { add }>add</button> { count }
    </div>
  )
}

export default App